import Vue from 'vue'; //VUE
import VueRouter from 'vue-router'; //路由控制组件
import Routers from '../routers/router';

Vue.use(VueRouter);

// 路由配置
const RouterConfig = {
    mode: 'hash',
    routes: Routers
};
const router = new VueRouter(RouterConfig);

router.beforeEach((to, from, next) => {
    if (to.meta.title) {
        document.title = to.meta.title
    }
    next()
});

export default router;